import request from '@/utiles/request.js'


export const getSingleConversation = async (id,sendId) => request.get(`/message/message/${id}/receiver/${sendId}`);
export const handlePinConversation = async (id) => request.get(`/message/pin/${id}`);
export  const getAllConversations = async(id)=>request.get(`/message/conversations/${id}`);
//export const sendMessageAPI  = async (id1,id2)=>request.post(`/message/${id1}/messege1/${id2}`);
export const sendMessageAPI = async(message)=>request.post(`/message/message`, message);
// 在 api/message.js 中添加
export const getMessagesByConversationId = (conversationId) => {
  return request({
    url: `/message/conversation/${conversationId}`,
    method: 'get'
  })
}
